Optimal. Leaf size=36 \[ -\frac {\log \left (a \cos ^2(e+f x)+b \sin ^2(e+f x)\right )}{2 (a-b) f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 36, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3751, 455, 36,
31} \begin {gather*} -\frac {\log \left (a \cos ^2(e+f x)+b \sin ^2(e+f x)\right )}{2 f (a-b)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 36
Rule 455
Rule 3751
Rubi steps
\begin {align*} \int \frac {\tan (e+f x)}{a+b \tan ^2(e+f x)} \, dx &=\frac {\text {Subst}\left (\int \frac {x}{\left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\text {Subst}\left (\int \frac {1}{(1+x) (a+b x)} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac {\text {Subst}\left (\int \frac {1}{1+x} \, dx,x,\tan ^2(e+f x)\right )}{2 (a-b) f}-\frac {b \text {Subst}\left (\int \frac {1}{a+b x} \, dx,x,\tan ^2(e+f x)\right )}{2 (a-b) f}\\ &=-\frac {\log (\cos (e+f x))}{(a-b) f}-\frac {\log \left (a+b \tan ^2(e+f x)\right )}{2 (a-b) f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.03, size = 37, normalized size = 1.03 \begin {gather*} -\frac {2 \log (\cos (e+f x))+\log \left (a+b \tan ^2(e+f x)\right )}{2 (a-b) f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.06, size = 48, normalized size = 1.33
method | result | size |
derivativedivides | \(\frac {\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 a -2 b}-\frac {\ln \left (a +b \left (\tan ^{2}\left (f x +e \right )\right )\right )}{2 \left (a -b \right )}}{f}\) | \(48\) |
default | \(\frac {\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 a -2 b}-\frac {\ln \left (a +b \left (\tan ^{2}\left (f x +e \right )\right )\right )}{2 \left (a -b \right )}}{f}\) | \(48\) |
norman | \(\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f \left (a -b \right )}-\frac {\ln \left (a +b \left (\tan ^{2}\left (f x +e \right )\right )\right )}{2 f \left (a -b \right )}\) | \(50\) |
risch | \(\frac {i x}{a -b}+\frac {2 i e}{f \left (a -b \right )}-\frac {\ln \left ({\mathrm e}^{4 i \left (f x +e \right )}+\frac {2 \left (a +b \right ) {\mathrm e}^{2 i \left (f x +e \right )}}{a -b}+1\right )}{2 f \left (a -b \right )}\) | \(72\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 31, normalized size = 0.86 \begin {gather*} -\frac {\log \left (-{\left (a - b\right )} \sin \left (f x + e\right )^{2} + a\right )}{2 \, {\left (a - b\right )} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 4.85, size = 40, normalized size = 1.11 \begin {gather*} -\frac {\log \left (\frac {b \tan \left (f x + e\right )^{2} + a}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \, {\left (a - b\right )} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 133 vs.
\(2 (29) = 58\).
time = 1.13, size = 133, normalized size = 3.69 \begin {gather*} \begin {cases} \frac {\tilde {\infty } x}{\tan {\left (e \right )}} & \text {for}\: a = 0 \wedge b = 0 \wedge f = 0 \\\frac {\log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a f} & \text {for}\: b = 0 \\- \frac {1}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} & \text {for}\: a = b \\\frac {x \tan {\left (e \right )}}{a + b \tan ^{2}{\left (e \right )}} & \text {for}\: f = 0 \\- \frac {\log {\left (- \sqrt {- \frac {a}{b}} + \tan {\left (e + f x \right )} \right )}}{2 a f - 2 b f} - \frac {\log {\left (\sqrt {- \frac {a}{b}} + \tan {\left (e + f x \right )} \right )}}{2 a f - 2 b f} + \frac {\log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a f - 2 b f} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 122 vs.
\(2 (36) = 72\).
time = 0.65, size = 122, normalized size = 3.39 \begin {gather*} -\frac {\frac {\log \left (a + \frac {2 \, a {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {4 \, b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {a {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}{a - b} - \frac {2 \, \log \left ({\left | -\frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1 \right |}\right )}{a - b}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 11.85, size = 66, normalized size = 1.83 \begin {gather*} -\frac {\mathrm {atan}\left (\frac {a\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}-b\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}}{2\,a+a\,{\mathrm {tan}\left (e+f\,x\right )}^2+b\,{\mathrm {tan}\left (e+f\,x\right )}^2}\right )\,1{}\mathrm {i}}{f\,\left (a-b\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________